<div id="header">
    <el-menu theme="dark" :default-active="activeIndex" class="el-menu-demo" mode="horizontal"
             @select="handleSelect">
        <el-menu-item index="1">管理后台</el-menu-item>
        <el-menu-item index="3">订单管理</el-menu-item>
        <el-submenu index="2" style="float: right;">
            <template slot="title">我的工作台</template>
            <el-menu-item index="2-1">
                <a href="{{ route('logout') }}"
                   onclick="event.preventDefault();
                                                     document.getElementById('logout-form').submit();">
                    退出登录
                </a>

                <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                    {{ csrf_field() }}
                </form>
            </el-menu-item>
            <el-menu-item index="2-2">选项2</el-menu-item>
            <el-menu-item index="2-3">选项3</el-menu-item>
        </el-submenu>
    </el-menu>
</div>